import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt


# mpl.use('Agg')

def main():
    x = np.linspace(0, 2 * np.pi, 400)
    y = np.sin(x ** 2)

    # fix, ax = plt.subplots()
    # ax.plot(x, y)
    # ax.set_title('Simple plot')

    f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
    ax1.plot(x, y)
    ax1.set_title('Sharing Y axis')
    ax2.set_title('Hello subplots')

    ax2.scatter(x, y)

def contour_func():
    x = np.arange(1, 10)
    y = x.reshape(-1, 1)
    h = x * y
    cs = plt.contourf(h, levels=[10, 30, 50],
                      colors=['#808080', '#A0A0A0', '#C0C0C0'],extend='both', cmap='Set3')
    cs.cmap.set_over('red')
    cs.cmap.set_under('blue')
    cs.changed()



if __name__ == '__main__':
    # a = np.random.randint(1, 10, 10)
    # plt.plot(a, 'o')
    # plt.show()
    # print(a)
    # main()
    contour_func()
    plt.show()
